const { DataTypes, DATE } = require("sequelize");
const seq = require("../db/seq");

//创建模型类
const Article = seq.define("Article", {
  articleTitle: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: false,
    comment: "面经标题",
  },
  articleContent: {
    type: DataTypes.TEXT,
    allowNull: false,
    unique: false,
    comment: "面经内容",
  },
  lookNum: {
    type: DataTypes.BIGINT,
    allowNull: false,
    unique: false,
    comment: "浏览量",
  },
  articleType: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: false,
    comment: "面经类别",
  },
  articlePreView: {
    type: DataTypes.TEXT,
    allowNull: false,
    unique: false,
    comment: "面经预览",
  },
  userId: {
    type: DataTypes.INTEGER,
    allowNull: false,
    unique: false,
    comment: "作者Id",
  }
});

// Article.sync({ force: true })

module.exports = Article;
